import type {  ArticleData, ChannelData, channelsDete } from '@/types/article.d.ts'
import type { LoginParams, LoginData, userData,   } from '@/types/user'
import { request } from '@/utils/https'

/**
 * @description: 登录函数
 * @param {*} data { mobile,password }
 * @return {*} promise
 */
export const loginAPI = (data: LoginParams) => {
  return request<LoginData>('/v1_0/authorizations', 'POST', data)
}


/**
 * @description: 获取用户个人资料
 * @param {*} arr { mobile,password }
 * @return {*} promise
 */
export const LaYoutAPI = ()=>{
  return request<userData>('/v1_0/user/profile','GET')
}

/**
 * @description: 获取文章详情
 * @param {*}
 * @return {*}
 */
export const ArticlesAPI = (params:channelsDete)=>{
  return request<ArticleData>('/v1_0/mp/articles','GET',params)
}

/**
 * @description: 获取所有频道列表
 * @param {*}
 * @return {*}
 */
export const  ChannelsAPI =()=>{
  return request<ChannelData>('/v1_0/channels','GET')
}
